package top.xia17.plugins.fast.dynamic.datasource.dao;

import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.data.jpa.repository.support.JpaRepositoryFactory;

/**
 * 是否扫描jpa的实体
 *
 * @author xia17
 * @date 2022/4/13
 */
@ConditionalOnProperty(
        prefix = "xia17fast.dynamic-datasource",
        name = {"jpa-enabled"},
        havingValue = "true"
)
@ConditionalOnClass(JpaRepositoryFactory.class)
@EnableJpaRepositories(basePackages = "top.xia17.plugins.fast.dynamic.datasource.dao")
@EntityScan(basePackages = "top.xia17.plugins.fast.dynamic.datasource.dao")
public class DynamicDatasourceJpaConfig {


}
